var t = getApp();

Page({
    data: {
        zy: "\n",
        id: "",
        show: !1,
        integral: ""
    },
    onLoad: function(t) {
        this.data.id = t.id, this.getData();
    },
    showCloseTap: function(t) {
        this.setData({
            show: !1
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var e = this, a = t.getNetAddresss("plugin.zhp-group-lottery.frontend.pearl.exchange-page");
        t._postNetWork({
            url: a,
            data: {
                activity_id: this.data.id
            },
            success: function(t) {
                var a = t.data;
                1 == a.result ? (console.log(a), wx.setNavigationBarTitle({
                    title: "".concat(a.data.plugin_name, "激活兑换")
                }), e.setData({
                    plugin_name: a.data.plugin_name,
                    pearl: a.data.pearl
                })) : wx.showToast({
                    title: a.msg,
                    duration: 1e3,
                    icon: "none"
                });
            }
        });
    },
    exchangeIntegral: function() {
        var e = this, a = t.getNetAddresss("plugin.zhp-group-lottery.frontend.pearl.exchange-pearl");
        t._postNetWork({
            url: a,
            data: {
                activity_id: this.data.id
            },
            success: function(t) {
                var a = t.data;
                1 == a.result ? e.setData({
                    show: !0,
                    exchange_pearl: a.data.exchange_pearl
                }) : wx.showToast({
                    title: a.msg,
                    duration: 1e3,
                    icon: "none"
                });
            }
        });
    },
    gotoUrl: function(t) {
        "Integral_love" == t.currentTarget.dataset.key && wx.navigateTo({
            url: "/packageB/member/love/Love_index/Love_index"
        });
    },
    gotoLog: function() {
        wx.navigateTo({
            url: "/packageI/newGroup/redeemLog/redeemLog?id=" + this.data.id
        });
    }
});